<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Spring期末项目</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">

    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>

</head>
<body class="login-bg">
<p class="center" style="text-align: center;font-size: 35px">登录用户名为：admin，密码为123456</p>
<div class="login layui-anim layui-anim-up">
    <div class="message">Spring期末-202苏泽昀-登录</div>
    <div id="darkbannerwrap"></div>

    <form method="post" class="layui-form" action="/login/doLogin/">
        <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" value="admin">
        <hr class="hr15">

        <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input" value="123456">
        <hr class="hr15">

        <input name="vCode" placeholder="请输入验证码" type="text" lay-verify="required" class="layui-input" id="checks">
        <div style="text-align: center; margin-top: 15px;margin-bottom: 15px">
            <img src="/login/checkCode" id="checkCode" title="看不清，点击换一张" alt="" width="100" height="32" class="center-block" style="height:43px;cursor:pointer;" onclick="getPic()"/>
        </div>
        <hr class="hr15" >

        <input value="登录" style="background:#0dc316;" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>
</div>

<script>
    $(function  () {
        layui.use('form', function(){
            var form = layui.form;
            form.on('submit(login)', function(data){
                return true;
            });
        });
    });
    function getPic(){
        $("#checkCode").attr("src","/login/checkCode?flag="+Math.random());
    };
</script>
<script type="text/javascript">
    /**
     * 登录超时 展示区跳出iframe
     */
    var _topWin = window;
    while (_topWin != _topWin.parent.window) {
        _topWin = _topWin.parent.window;
    }
    if (window != _topWin)
        _topWin.document.location.href = '${pageContext.request.contextPath}/login/showLogin.jsp';
</script>
<!-- 底部结束 -->
</body>
</html>